<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="com.java.service.*,java.util.*,com.java.model.UserSession,com.java.util.*"%>
<jsp:include page="/jsp/common/header.jsp"></jsp:include>
<%
	
	String poi_kisu_std_no 		= CmmUtil.nvl(request.getParameter("poi_kisu_std_no"),"");
	String poi_nm				= CmmUtil.nvl(request.getParameter("poi_nm"),"");
	String login_nm				= CmmUtil.nvl(request.getParameter("poi_login_nm"),"");
	
	HashMap map = new HashMap();
	HashMap map1 = null;
	ArrayList list = new ArrayList();
	CommonDaoService commonservice = new CommonDaoService("Com0102lp02Pop01_restudyDao");
	map.put("poi_kisu_std_no",poi_kisu_std_no);
	
	list = (ArrayList)commonservice.commonDaoMethod(map);

	int jindo_rate = 0;
	
	int self_height = list.size();
	self_height = self_height * 50;
	
	if(self_height == 0){
		self_height = 200;
	}
%>
<script>
	//self.resizeTo(650,<%=self_height%>);
	function _go_study(){
		document.mform.action = "/jsp/pop/com0102l_p02_pop01.jsp";
		document.mform.submit();
	}	
</script>
<body>
<form name="mform">
<input type="hidden" name="poi_kisu_std_no" value="<%=poi_kisu_std_no%>">
<input type="hidden" name="poi_nm" value="<%=poi_nm %>">
<input type="hidden" name="poi_login_nm" value="<%=login_nm %>">
</form>
<table width="620" cellpadding="0" cellspacing="0" style="border-collapse:collapse; border:1px solid #1a518a" align="left">
  <tr>
    <td>
    	<table width="620" height="25" border="0" cellpadding="0" cellspacing="0"  align="left">
        	<tr>
            	<td align="left">
                	<table border="0" cellpadding="0" cellspacing="0" align="left">
                    <tr style="background-color:#4b80b6">
                   	 <td width="601" align="left" style="font-size:14px; color:#ffffff; font-weight:bold;"><img src="/images/popup_icon1.gif" alt="" border="0" style="padding:0 0 2px 0;"/>&nbsp;[<%=poi_nm %>(<%=login_nm %>)]</td>
                	 <td align="right"><a href="javascript:self.close()"><img src="/images/popup_icon2.gif" alt="" border="0" style="padding:0 0 2px 0;"/></a></td>
                    </tr>
					<tr height="1">
						<td colspan="2"></td>
					</tr>
					<tr>
						<td colspan="2">
							<table width="100%" border="0">
		                      <tr height="22">
		                        <td style="background-color:#cccccc;font-size:12px; color:#000000; font-weight:bold;" align="center"><a href="javascript:_go_study()">학습 진도 현황</a></td>
		                        <td style="background-color:#4b80b6;font-size:12px; color:#ffffff; font-weight:bold;" align="center">복습 진도 현황</td>
		                      </tr>
							</table>
						</td>
					</tr>
                    </table>
                </td>
            </tr>
            <tr>
            	<td align="center">
                	<table width="100%" border="0" class="main_table3">
                      <tr>
                        <td class="table_th">No</td>
                        <td class="table_th">차시명</td>
                        <td class="table_th">진도율</td>
						<td class="table_th">학습시간</td>
						<td class="table_thEND">학습시작일</td>
                      </tr>
                     <%if(list !=null && list.size() > 0){  %>
                      <%for(int i=0; i<list.size(); i++){
                    	  map1 = (HashMap)list.get(i);
                    	  jindo_rate = Integer.parseInt((String)map1.get("jindo_rate"));
					  %>
                      <tr>
                        <td><%=i+1 %></td>
                        <td><%=map1.get("chasi_nm") %></td>
                        <td style="padding:3px" align="left">
                        	<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #ffffff;">
                        		<tr>
                        			<td>
                    					<div style="float:left; width:2px; height:14px; background:url(/images/graph/orange_head.gif); vertical-align:top;"></div>
										<div style="float:left; width:<%=jindo_rate*1.8 %>px; height:14px; background:url(/images/graph/orange_body.gif); vertical-align:top;"></div>
										<div style="float:left; width:2px; height:14px; background:url(/images/graph/orange_foot.gif); vertical-align:top;"></div>
										&nbsp;&nbsp;(<%=jindo_rate %>%)
									</td>
								</tr>
								<tr>
									<td><%=(String)map1.get("std_page") %></td>
								</tr>
                            	<!-- tr>
                                	<td style="border:1px solid #ffffff;"><img src="images/lesson_rate.gif" alt="" border="0">&nbsp;100%</td>
                                </tr-->
                            </table>
                        </td>
						<td><%=(String)map1.get("std_time") %></td>
						<td><%=(String)map1.get("std_start") %></td>
                      </tr>
                      <%} %>
                     <%}else{ %>
                     <tr>
                     	<td colspan="10">데이터가 없습니다</td>
                     </tr>
                     <%} %>
                    </table>

                </td>
            </tr>
            
        </table>
     </td>
  </tr>
</table>
</body>
</html>
